/*
 * MIT License
 *
 * Copyright (c) 2024-2048 冰羽
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */

package cn.star.framework.excel.handler.settings;

import java.util.List;
import lombok.Getter;
import lombok.Setter;

/**
 * 头注解<br>
 *
 * @author zhaoweiping
 *     <p style='color: red'>Created on 2024-09-23 11:06:00
 * @since 3.0.0
 */
public class HeaderComment {

  @Getter @Setter private List<Comment> comments;

  public HeaderComment(List<Comment> comments) {
    this.comments = comments;
  }

  public static class Comment {
    /** 定位行 */
    @Getter @Setter private int rowIndex;

    /** 定位列 */
    @Getter @Setter private int colIndex;

    /** 行偏移 */
    @Getter @Setter private int rowOffset = 1;

    /** 列偏移 */
    @Getter @Setter private int colOffset = 1;

    /** 注释文本 */
    @Getter @Setter private String text;

    /** 作者 */
    @Getter @Setter private String author;

    public Comment(int rowIndex, int colIndex, String text) {
      this.rowIndex = rowIndex;
      this.colIndex = colIndex;
      this.text = text;
    }

    public Comment(int rowIndex, int colIndex, String text, String author) {
      this(rowIndex, colIndex, text);
      this.author = author;
    }

    public Comment(int rowIndex, int colIndex, int rowOffset, int colOffset, String text) {
      this(rowIndex, colIndex, text);
      this.rowOffset = rowOffset;
      this.colOffset = colOffset;
    }

    public Comment(
        int rowIndex, int colIndex, int rowOffset, int colOffset, String text, String author) {
      this(rowIndex, colIndex, rowOffset, colOffset, text);
      this.author = author;
    }
  }
}
